package com.tjbklx1.pattern.specification.demo3;

public class SpecificationNot extends CompositeSpecification {
	// 传递一个规格书
	private IUserSpecification spec;

	public SpecificationNot(IUserSpecification _spec) {
		this.spec = _spec;
	}

	// not操作
	@Override
	public boolean isSatisfiedBy(User user) {
		return !spec.isSatisfiedBy(user);
	}
}